package com.twohand.admin.Controller;

import com.twohand.admin.Service.FileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping("/uploadfile")
public class FileController {
    @Autowired
    FileService fileService;
    @PostMapping("/image")
    String imageUpload(@RequestBody MultipartFile file,String type){
        return fileService.uploadImage(file,type);
    }
}
